-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow multiple signing keys to be provided #4632
Allow multiple signing keys to be provided #4632
Conversation
Signed-off-by: Stephen Crawford <[email protected]>
Signed-off-by: Stephen Crawford <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4632 +/- ##
==========================================
- Coverage 65.26% 65.22% -0.05%
==========================================
Files 317 317
Lines 22311 22319 +8
Branches 3588 3590 +2
==========================================
- Hits 14562 14558 -4
- Misses 5954 5964 +10
- Partials 1795 1797 +2
|
src/main/java/com/amazon/dlic/auth/http/jwt/HTTPJwtAuthenticator.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Stephen Crawford <[email protected]>
Signed-off-by: Stephen Crawford <[email protected]>
src/test/java/com/amazon/dlic/auth/http/jwt/HTTPJwtAuthenticatorTest.java
Show resolved
Hide resolved
src/test/java/com/amazon/dlic/auth/http/jwt/HTTPJwtAuthenticatorTest.java
Show resolved
Hide resolved
Signed-off-by: Stephen Crawford <[email protected]>
Signed-off-by: Stephen Crawford <[email protected]>
Signed-off-by: Stephen Crawford <[email protected]>
Signed-off-by: Stephen Crawford <[email protected]>
src/integrationTest/java/org/opensearch/test/framework/JwtConfigBuilder.java
Show resolved
Hide resolved
Thanks for creating a documentation issue as well. Do you plan to open a PR along with the issue? |
e2cd610
into
opensearch-project:main
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/security/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/security/backport-2.x
# Create a new branch
git switch --create backport/backport-4632-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 e2cd6101bf2d4f6c4877ec4692ed89be19af2d3b
# Push it to GitHub
git push --set-upstream origin backport/backport-4632-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/security/backport-2.x Then, create a pull request where the |
…o be provided) (#4666) Signed-off-by: Stephen Crawford <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a BWC test to ensure there is no breakage since the type of config is changing from singleton to list?
@krishna-ggk Settings.getAsList is backwards compatible with Settings.get(). The same yaml configuration for jwt can be used with both Settings.get and Settings.getAsList for the Example jwt config:
One potential issue that could arise would be trying to update the JWT authc config in a mixed cluster of 2.17 and <2.17 nodes. If the config update hit the 2.17 node and updated the jwt config then the <2.17 nodes would not know how to parse the new config. Edit: Settings.getAsList() supports either list entries or comma-separate entries in yaml. All of these configs work:
|
Thanks @cwperks for clarifying the backward compatibility aspects.
Does the config update through API generate list or CSV? If so, it could potentially cause issue by generating incompatible version even if only single value is provided. Admittedly though this should be a remote scenario. Potentially the least riskiest approach would be to introduce a pluralized attribute (signing_keys) which comes at expense of managing deprecation of older attribute. In interest of keeping things simple, I agree current approach is good enough. |
Description
[Describe what this change achieves]
This change is an enhancement which allows users to provide multiple signing keys when configuring JWT options.
Previously, users could only specify a single signing key when configuring their JWT options. As a result, if a user wanted to rotate their key, they would experience some amount of downtime since the cluster would have to reinitialize the update security configuration. This change does not stop the required bouncing, but because you can now provide multiple keys, you can provide backup(s) key(s) which means even when the cluster bounces you have the ability to send JWT requests with the backup key(s).
To specify the multiple keys, you just need to use the same method as before but separate the keys with a comma i.e. <key 1>, <key 2>, etc....
Issues Resolved
[List any issues this PR will resolve]
This PR addresses: #4613
Is this a backport? If so, please add backport PR # and/or commits #, and remove
backport-failed
label from the original PR.Do these changes introduce new permission(s) to be displayed in the static dropdown on the front-end? If so, please open a draft PR in the security dashboards plugin and link the draft PR here
No
Testing
[Please provide details of testing done: unit testing, integration testing and manual testing]
I added several new tests to the existing HTTPJWTAuthenticatorTest class.
Check List
New Roles/Permissions have a corresponding security dashboards plugin PRBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.